package com.xframe.event.bus.core.annotation;

import com.xframe.event.bus.core.msg.MsgMode;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 接收消息注解对象的实体类
 *
 * @author xufeng
 * @version 1.0
 * @date 2022-09-19
 */
@Data
@Accessors(chain=true)
public class ReceiveMsgArgs {
    /**
     * 接受消息的模式
     */
    private MsgMode msgMode;
    /**
     * 交换机名称
     */
    private String exchange;
    /**
     * 队列名称,多个使用逗号隔开
     */
    private String queue;
    /**
     * 路由KEY，多个使用逗号隔开
     */
    private String routingKey;
    /**
     * 每次接受的消息个数
     */
    private int qos;
    /**
     * 是否自动确认
     */
    private boolean autoAck;

    public ReceiveMsgArgs(){

    }

    public ReceiveMsgArgs(XReceiveMsg xReceiveMsg){
        this.autoAck = xReceiveMsg.autoAck();
        this.exchange = xReceiveMsg.exchange();
        this.msgMode = xReceiveMsg.msgMode();
        this.queue = xReceiveMsg.queue();
        this.qos = xReceiveMsg.qos();
        this.routingKey = xReceiveMsg.routingKey();
    }
}
